﻿#ifndef TCP_CLIENT_H
#define TCP_CLIENT_H

#include <QTcpSocket>

class TCP_Client:public QObject
{
    Q_OBJECT
public:
    TCP_Client();
    ~TCP_Client();

public slots:
    bool ConnectToServer(const QString Server_ip, const quint16 Server_port);
//    bool ConnectToServer(const QString Local_ip, const QString Server_ip, const quint16 Server_port);
    void DisconnectFromServer();
    void SendMessage(QByteArray msg);
    void ReadMessage();
signals:
    void TcpClientModeMsg(QByteArray message);
    void ConnectionBuilt();     //成功连接
    void ConnectionClosed();    //连接断开
private:
    QTcpSocket *MySocket;
};

#endif // TCP_CLIENT_H
